package cn.lili.modules.system.entity.dos;

import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 会员列表
 * </p>
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("li_vip")
@ApiModel(value="LiVip", description="会员列表")
public class LiVip extends BaseStandardEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "vip配置名称")
    @TableField("vip_id")
    private Long vipId;

    @ApiModelProperty(value = "vip配置名称")
    @TableField("vip_name")
    private String vipName;

    @ApiModelProperty(value = "会员状态1正常，2已过期，3冻结，4城市站点冻结。字典：vip_status")
    @TableField("vip_status")
    private Integer vipStatus;

    @ApiModelProperty(value = "联系方式")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "会员有效截止日期")
    @TableField("end_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date)
    private Date endTime;

    @ApiModelProperty(value = "开通方式1微信，2支付宝，3余额，4绿色积分，5激活码。字典:pay_way")
    @TableField("opening_mode")
    private Integer openingMode;

    @ApiModelProperty(value = "激活码（第一次使用激活码充值需要记录，后续不记录）")
    @TableField("active_code")
    private String activeCode;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
    @TableField(exist = false)
    private Date endTimeTow;
}
